<?php
$year = $this->Semester['year'];
$semester = $this->Semester['semester'];
$semesterClass = new Semester_Model_SemesterClass();
// 班級陣列
$className = $semesterClass->getClassNames($year,$semester);
 $text = new Default_Model_SystemText();
 // 身分別陣列
 $textOptions = $text->getKindArray('stud_kind');
?>
<table border="1" class="newspaper-a">
<thead>
<tr>
<th><?php echo $this->translate('student character')?></th>
<th><?php echo $this->translate('student id')?></th>
<th><?php echo $this->translate('class name')?></th>
<th><?php echo $this->translate('number')?></th>
<th><?php echo $this->translate('student name')?></th>
<th><?php echo $this->translate('student sex')?></th>
<th><?php echo $this->translate('dentification_number')?></th>
<th><?php echo $this->translate('birthday')?></th>
<th><?php echo $this->translate('address')?></th>
<th><?php echo $this->translate('home phone')?></th>
<th><?php echo $this->translate('father')?></th>
<th><?php echo $this->translate('mother')?></th>
<th><?php echo $this->translate('guardian')?></th>
</tr>
</thead>
<tbody>
<?php foreach ($this->data as $val):?>
<tr>
<td><?php echo $textOptions[$val['kind']]?></td>
<td><?php echo $val['student_id']?></td>
<td><?php echo $className[$val['grade'].'-'.$val['class_sn']]?></td>
<td><?php echo $val['number']?></td>
<td><?php echo $val['name']?></td>
<td><?php if($val['sex']=='M') echo $this->translate('boy') ;else echo $this->translate('girl')?></td>
<td><?php echo $val['identification_number']?></td>
<td><?php echo $val['birthday']?></td>
<td><?php echo $val['address']?></td>
<td><?php echo $val['phone_home']?></td>
<?php
$arr =array();
foreach($val['Student_Model_StudentParents'] as $parents)
$arr[$parents['sex']] = $parents['name'];
?>
<td><?php if(isset($arr['M']))echo $arr['M']?></td>
<td><?php if(isset($arr['F']))echo $arr['F']?></td>
<td><?php echo $val['guardian_name']?></td>
</tr>
<?php endforeach?>
</tbody>
</table>